package com.outfit.boot.okhttp;


import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * OkHttp 参数配置
 *
 * @author ming
 * @date 2019-09-10 16:52
 * <p>company: 杭州行装网络技术有限公司</p>
 * <p>修改履历：</p>
 */
@ConfigurationProperties(prefix = "outfit.okhttp")
public class OkHttpProperties {
    /**
     * 最大空闲连接数
     */
    private int maxIdleConnections = 200;
    /**
     * 连接超时时间（毫秒）
     */
    private long connectTimeout = 30_000;
    /**
     * 读超时时间（毫秒）
     */
    private long readTimeout = 30_000;
    /**
     * 写超时时间（毫秒）
     */
    private long writeTimeout = 30_000;
    /**
     * 保活持续时间（毫秒）
     */
    private long keepAliveDuration = 300_000; // 默认5分钟

    public int getMaxIdleConnections() {
        return maxIdleConnections;
    }

    public void setMaxIdleConnections(int maxIdleConnections) {
        this.maxIdleConnections = maxIdleConnections;
    }

    public long getConnectTimeout() {
        return connectTimeout;
    }

    public void setConnectTimeout(long connectTimeout) {
        this.connectTimeout = connectTimeout;
    }

    public long getReadTimeout() {
        return readTimeout;
    }

    public void setReadTimeout(long readTimeout) {
        this.readTimeout = readTimeout;
    }

    public long getWriteTimeout() {
        return writeTimeout;
    }

    public void setWriteTimeout(long writeTimeout) {
        this.writeTimeout = writeTimeout;
    }

    public long getKeepAliveDuration() {
        return keepAliveDuration;
    }

    public void setKeepAliveDuration(long keepAliveDuration) {
        this.keepAliveDuration = keepAliveDuration;
    }
}
